package com.buvaka.features;

public class LineString implements Features {

	private LatLng[] points;
	private String properties;
	
	public LineString(LatLng[] points){
		this.points = points;
	}
	
		
	@Override
	public String getProperties() {
		return new StringBuilder().append("\"").append(properties).append("\"").toString();
	}
	
	@Override
	public String toString(){
		StringBuilder str = new  StringBuilder().append(OPEN).append(TYPE_LINE_STRING).append(COMMA).append(COORDINATES).append(OPEN_ARRAY);
		for(LatLng p : points){
			str.append(p).append(COMMA);
		}
		str.setLength(str.length() - 2); //remove comma + space at the end
		return str.append(CLOSE_ARRAY).append(CLOSE).toString();
		
	}

}
